Fix Android video recording: color pipeline + RVCCA build guard#319
Merged
doranteseduardo merged 2 commits intoReactVision:mainfrom Apr 27, 2026
Merged
Conversation
The encoder-input EGL surface was declared as sRGB, causing Tensor/Mali drivers to gamma-linearize every framebuffer write and the encoder to emit color_transfer=iec61966-2-1 on the MP4. The result: mis-tagged pixels unrepairable by remux, and GPU throughput throttled to ~10 fps on Mali-G710. Exynos devices ignored the flag and worked by accident. Drop the EGL_GL_COLORSPACE_SRGB_KHR attribute; the encoder now emits BT.709 SDR consistently across SoCs and per-write gamma is gone. Under VROColorRenderingMode::Linear (HDR) the scene framebuffer holds linear RGB values that used to rely on the driver's implicit gamma from the dropped flag. Run the existing gamma post-process explicitly on the recording path for that mode; non-linear mode blits through. Fix a dormant bug in the gamma post-process while there: the samplers list named "hdr_texture" but the shader sampled from "srgb_texture", leaving the sampler unbound and producing black frames. The recording path is the first caller to exercise it in HDR.
The function takes a ReactVisionCCA::RVCCAGeospatialProvider* and dereferences it to call computeArPosition, but RVCCAGeospatialProvider is only forward-declared when RVCCA_AVAILABLE=0, so the definition fails to compile in any build without the proprietary libreactvisioncca headers present. All call sites are already inside #if RVCCA_AVAILABLE blocks; wrap the definition to match.
doranteseduardo
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Video recording color output & throughput
On Tensor/Mali the encoder-input EGL surface tagged as sRGB caused
color_transfer=iec61966-2-1mis-tagging and ~10 fps throttling from per-write gamma. Exynos ignored the flag so this only surfaced on Pixel/Tensor. Drops the flag, applies gamma explicitly for HDR, and fixes a latent sampler-name bug in the gamma post-process shader.Verified on Pixel 7a (broken) and Samsung A50 (reference); both now emit BT.709 SDR with matching pixels and ~30 fps recording.
2. RVCCA build guard
createLocalGPSAnchoris defined outside any#if RVCCA_AVAILABLEblock but dereferences a forward-declared type. Breaks any build withoutlibreactvisionccaheaders present (public CI included). All call sites are already guarded; wraps the definition to match.